The Photoshop Dither Filter package is a set of filters for Adobe Photoshop that dither color or grayscale images to black and white so that they can be printed on a bilevel device, such as a laser printer. It currently consists of two filters: VGDither and PNDither. When printing to a laser printer, these dithering algorithms may be superior to the halftoning algorithms that are built into Photoshop. Why is that?
Laser printers suffer from a problem called dot gain: isolated black pixels on the printed page are larger than they “should” be. In fact, a certain amount of dot gain is unavoidable: since the dots that a laser printer makes are round, each dot has to overlap slightly with its neighbors so that the laser printer can produce a solid black. What this means is that most laser printer output is slightly darker than it should be. In practice, most laser printers produce dots which are somewhat larger than this minimum necessary dot size, making the problem even worse.
The standard PostScript halftoning algorithm (which Photoshop calls “Halftone Screen”) compensates for this dot gain by clustering black dots together—it doesn’t matter if a dot is larger than it should be if the dot it overlaps is also black. Unfortunately, by clustering the dots, this halftoning algorithm loses some of the detail in the original image.
Another of Photoshop’s algorithms, Diffusion Dither, produces an image with much more detail than Halftone Screen, but it makes no attempt to compensate for dot gain. Since it produces many isolated black (and white) dots, the printed results are much darker than they should be. It is possible to partially compensate for this darkening by adjusting brightness and contrast before converting to a bitmap, but this adds an extra step and the results may still be unsatisfactory.
Each of the filters in this package uses a different method to attempt to compensate for dot gain. More information about them is given below.
Installing and using the filters.
Drag the VGDither and PNDither files into the “Plug-ins” folder in the folder which contains your Photoshop application. That’s it!
The next time you start Photoshop, a new “Halftone” submenu will appear in the Filter menu, and the filters you have installed will appear in this submenu.
To remove the filters (though I can’t imagine why you would want to do that : -) ), simply drag them out of the Plug-ins folder.
Very important: before printing your converted image, you should convert it to a Bitmap using the 50% Threshold method. If you don’t, what prints will not be what you expect! If you've dithered a color image, you will have to separate the layers into separate documents, one for each color, before you can do that.
VGDither
The VGDither filter dithers a grayscale image to black and white using the Velho-Gomes algorithm [1]. The Velho-Gomes algorithm attempts to steer a course between the Halftone Screen algorithm and the Diffusion Dither algorithm. It clusters dots to minimize the effect of dot gain, but does so in a way that keeps more detail than the Halftone Screen algorithm.
The “Cluster size” parameter controls how many pixels VGDither considers when painting pixels black—the larger the number, the more pixels it considers at one time, and the larger the groups of black pixels. The default value of 11 is a good compromise between preserving detail and the original tonal values. Larger values will produce grainier pictures, while smaller ones will not do as good a job of preserving the brightness and contrast. A cluster of 1 will produce results that are very similar to those produced by Diffusion Dither, but not nearly as quickly. Note that not all values will produce results that are as good as you might expect! If you try a cluster value that produces large horizontal or vertical clusters of dots or other artifacts, try a slightly different value. Through experimentation, I have found that 14 and 23 also produce good results; other good values also exist.
The “Offset” parameter controls how the dithered channels overlap in a RGB or CMYK image. An offset of 0 causes them to overlap as much as possible, while a positive value makes them overlap less. I’m not sure whether this is useful in practice (that is, in printing) or not, but it causes the dithered image to appear more saturated on the screen.
Finally, the “Adaptive cluster” option controls whether the amount of clustering is adjusted automatically. If adaptive cluster is off, VGDither always uses the cluster value that you specify. When it is on, VGDither will automatically reduce the cluster size in the complicated areas of the image. This better preserves the image detail, at the expense of less compensation for dot gain.
[1] Velho, Luiz and Jonas de Miranda Gomes, “Digital Halftoning with Space Filling Curves.” Computer Graphics, v25 n4, July 1991.
PNDither
The PNDither filter implements a modified version of the Pappas-Neuhoff algorithm [2]. The algorithm described in this paper is a version of the Floyd-Steinberg Error Diffusion algorithm that uses a physical model of a laser printer to take into account how making a dot black will actually affect the blackness of the page. PNDither modifies this algorithm by adding blue noise [3], which reduces the patterns that the Floyd-Steinberg algorithm tends to produce. What this means is that PNDither should produce results with as much detail as those produced by Photoshop’s Diffusion Dither, while doing a much better job of preserving the tones of the original image.
The “Dot diameter” parameter is used to tell the filter how much dot gain to compensate for. An ideal printer, one with the smallest dot that allows it to produce a solid black, would have a dot diameter of 1.0. The default value of 1.1 should be about right for most laser printers. If you find that the printed results are too dark, use a larger value; if too light, use a smaller one. Allowed values are in the range 1.0 to 1.414. Next to the dot diameter parameter you enter is the percent dot gain that the given dot diameter corresponds to. Since the filter is compensating for distortions produced by the printer, it is not possible to judge on screen exactly how the printed result will look; you need to actually print it to do that. However, if you check the “Simulate dot gain” checkbox, PNDither will color the white pixels around a black pixel to approximate what the results of dot gain will be.
[2] Pappas, Thrasyvoulos N. and David L. Neuhoff, “Model-Based Halftoning.” SPIE, Vol 1453 (1991).
[3] Ulichney, Robert A. “Dithering with Blue Noise.” Proceedings of the IEEE, Vol 76, No 1, January 1988.
Change history.
Check the web page (http://pertsserver.cs.uiuc.edu/~hull/halftone/) for the latest version.
Version 1.8
Fixed a serious bug in VGDither that could potentially cause it to corrupt memory.
Version 1.7
PNDither wasn't updating its scripting parameters correctly. If you recorded PNDither in an Action and played it back, you would get the default dot diameter. Neither PNDither nor VGDither were handling layers with transparency correctly—they were dithering the transparency layer along with the other layers. Added dot gain estimate and “Simulate dot gain” option to PNDither.
Version 1.6
Both filters are now scriptable under Photoshop 4.0. VGDither's preview is finally scrollable.
Version 1.5
Improved the output of VGDither on multi-plane (RGB or CMYK) images when adaptive cluster is turned on. Previously, some areas of the image would have faint blocky artifacts because the offsets of the different planes would no longer be synchronized when the adaptive cluster caused a cluster to be shorter than the default. In the new version, the offsets between planes is preserved.
Version 1.4
Fixed a bug in VGDither's preview.
Version 1.3
Added adaptive cluster to VGDither. When adaptive cluster is turned on, the cluster value is automatically reduced in complicated areas of the image, better preserving image detail. Changed how the offset worked: now the offset is rotated through the channels so that each gets an equal chance to be uncovered. The old way resulted in the image having a cast of the color of the first channel. Added adaptive centering, which causes each cluster to be centered on the darkest part of the cluster. This should improve the detail, especially in high-contrast areas of the image.
Also, I’m embarassed to admit, fixed two bugs. The first, in PNDither, was a memory leak when the filter was canceled in the middle. The second was an erroneous assumption in VGDither that inRowBytes was equal to outRowBytes—I think that in practice this assumption was only ever wrong for very small images. The bug would cause an incorrect image, and don’t worry, it you had seen it you would know.
Version 1.2
The filters now work with RGB and CMYK images as well as grayscale. I’m not sure if this is very useful, because it may be difficult to get some applications to print the image out without putting it through another halftone screen. I was able to get a test to print correctly by saving the file as an EPS and including the default halftone screen in the EPS file. This method may work but produces files that are much bigger than they need to be.
In this version, VGDither needs System 7 to run. I’ll fix that in a future version.
Version 1.1
The filters are now fat, and will run much faster on a PowerPC Macintosh.
Version 1.0
Initial release.
Enhancements planned for future versions: Better documentation. Use less memory. Implement more algorithms. If you use VGDither or PNDither, let me know! (See contact information below.) Check the web site for the latest versions.
Copyright and contact information.
The Photoshop Dither Filter package consists of the files:
README (this file)
PNDither (version 1.7b0)
VGDither (version 1.8b0)
It is Copyright 1994–1997 David Hull. All rights reserved. However, the author grants permission to distribute copies of this package as long as they are complete and unmodified. No money may be charged except for nominal copying and distribution charges.
I can be reached for suggestions, encouragement, or bug reports at:
David Hull
1304 W Springfield Ave
Urbana, IL 61801 USA
e-mail: dlhull@uiuc.edu
http://pertsserver.cs.uiuc.edu/~hull/halftone/
I try to respond to all messages I receive, but I am a graduate student and am currently in the final push to complete my thesis. If I am slow to answer, please forgive me!